import axios from 'axios';
import dayjs from 'dayjs';

let barcodeList = ["RCT-4PA05003-20231115-000006",
    'RCT-4PA05003-20231115-000005',
    'RCT-4PA05003-20231115-000004',
    'RCT-4PA05003-20231115-000003',
    'RCT-4PA05003-20231115-000002',
    'RCT-4PA05003-20231115-000001',
    'RCT-3EE15205-20231102-000001',
    'RCT-3HW02084-20230927-000004',
    'RCT-3HW02084-20230927-000002',
    'RCT-3HW02084-20230927-000001',
    'RCT-3HW02084-20230927-000005',
    'RCT-3HW02084-20230927-000003',
    'RCT-3HW02084-20230927-000006',
    'RCT-3HW02084-20230927-000007',
    'RCT-3HW02084-20230927-000008',
]

barcodeList.forEach((item, index) => {

    console.log(`\n当前是第${index}请求 时间是${dayjs().format("HH:mm:ss:SSS")}`)
    axios.post("http://192.168.2.69:30095/inventory/check/record/submit", {
            "barcode": item,
            "checkCount": 15,
            "checkListId": "a6c545e5ec69485020327745fb717c1b",
            "wareLocationCode": "Z04052"
        }, {
            headers: {
                'Authorization': 'eyJhbGciOiJIUzUxMiJ9.eyJhY2Nlc3NfdG9rZW4iOiJ1c2VyXzZjYjk4MmMzYTRhMDRmNmQ4YTEzMWRhMzk4YTcxMTMxIiwidWlkIjoiNGYwNTQxNjY3NTViMmZlMzVkMzk2NDYxM2UyYmUyZDkiLCJyb2xlIjpbIjNiNTYxNmU1LTU5MjYtNGQ5My04ZmIwLWYwNjcyMGZlY2E2ZSIsImU3ZjA3MTE0LWM3NDktNDFkZi1iMWYwLTNlNjA2ZWEzNGMyMyIsIjcyMzIxMGE3LTk4M2QtNDNlZS04MjUwLTQ1M2U0Y2RlN2RmZCIsImM5NTFkZDQ5LTI1MjYtNDdmOS1iNzQxLTVkNWQyNTE2YjdmZCIsIjJjYjA0NGVmLTVlMjYtNDc0Yy05MDdmLWQ1YTlmMTgxZjg2MiJdLCJuYW1lIjoi5pyx6ZuB5r-gIiwiZGVwSWQiOiIyYjliY2M4YjY2ZjAxOTRhNjg3MmE4MmEzY2JkOTM4ZiIsImVtcE5vIjoiUjAxNTYiLCJleHAiOjE3MDMxNDc0NDQsImlhdCI6MTcwMzE0MDI0NH0.QGTAesjUXSb-SdKwNr6CYmjhYB3HUpxtWeW6HY25140UhFq2VJcwvkWg5_aZI_HU0xymTJA1y5U1AIYGDxy2kQ'
            }
        }
    ).then(res => {
        console.log("请求成功", res.data)
    })

})
